export default {
  onShareAppMessage(res) {
    const pages = getCurrentPages();
    const currentPage = pages[pages.length - 1];
    const path = `/${currentPage.route}`;
    const query = Object.keys(currentPage.options)
      .map(key => `${key}=${currentPage.options[key]}`)
      .join('&');
    
    return {
      title: '全局转发标题', // 可从 Vuex 或 Store 动态获取
      path: `${path}${query ? '?' + query : ''}`,
      imageUrl: 'https://example.com/global-share.png'
    };
  },
  onShareTimeline() {
    return {
      title: '朋友圈标题',
      query: 'from=timeline'
    };
  }
};